setwd("~/Documents/GitHub/Resultados/docs/PrimeroDiffExpAllResults/Clasificando/Abundances")
load('CheackPointOne.RData')
head(pEhExvsCmasM,10);
## GenId CDC5_1 CDC5_2 CDC5_3 pEhEx_1 pEhEx_2 pEhEx_3
## 1 EHI_000130A 45.32378 107.82734 128.66351 180.07428 446.15729 516.14317
## 2 EHI_000140A 66.04322 317.74653 257.32703 363.20067 351.59134 41.84945
## 3 EHI_000240A 700.57610 1282.45711 877.45524 1208.63415 1993.15918 2290.09468
## 4 EHI_000250A 707.05093 430.16227 388.98271 334.20566 337.04273 710.66559
## 5 EHI_000260A 94.53245 108.97444 35.15805 112.16491 69.10588 54.24928
## 6 EHI_000280A 58.27343 50.47237 80.78872 56.46397 86.07926 66.64912
## 7 EHI_000290A 27.19427 14.91229 23.93740 19.07567 14.54861 87.57384
## 8 EHI_000300A 60.86336 143.38742 110.71046 137.34479 118.81363 34.09955
## 9 EHI_000410A 15.53958 21.79489 23.18935 28.99501 25.46006 70.52407
## 10 EHI_000430A 27.19427 27.53039 22.44131 26.70593 14.54861 11.62485
nbreaks <- 10
data1 <- pEhExvsCDC5; head(data1)
## GenId CDC5_1 CDC5_2 CDC5_3 pEhEx_1 pEhEx_2 pEhEx_3
## 1 EHI_000130A 72.59485 40.99764 280.54541 169.92967 411.34855 466.86626
## 2 EHI_000140A 111.02742 145.24877 643.77044 342.73950 324.16054 37.85402
## 3 EHI_000240A 876.83189 752.01378 1122.88829 1140.54489 1837.65493 2071.45616
## 4 EHI_000250A 492.50623 510.71341 232.49229 315.37794 310.74700 642.81736
## 5 EHI_000260A 12.81086 107.76521 2.11999 105.84602 63.71431 49.07003
## 6 EHI_000280A 58.36056 42.16900 171.71923 53.28303 79.36344 60.28603
sample1 <- data1$pEhEx_1; sample2 <- data1$pEhEx_2; sample3 <- data1$pEhEx_3;
samplevs1 <- data1$CDC5_1; samplevs2 <- data1$CDC5_2; samplevs3 <- data1$CDC5_3;
log2sample1 <- log2(sample1+1); log2sample2 <- log2(sample2+1)
log2sample3 <- log2(sample3+1); log2samplevsCDC51 <- log2(samplevs1+1)
log2samplevsCDC52 <- log2(samplevs2+1); log2samplevsCDC53 <- log2(samplevs3+1)
data1 <- cbind(data1, log2sample1,log2sample2,log2sample3,
log2samplevsCDC51,log2samplevsCDC52,log2samplevsCDC53)
head(data1)
## GenId CDC5_1 CDC5_2 CDC5_3 pEhEx_1 pEhEx_2 pEhEx_3
## 1 EHI_000130A 72.59485 40.99764 280.54541 169.92967 411.34855 466.86626
## 2 EHI_000140A 111.02742 145.24877 643.77044 342.73950 324.16054 37.85402
## 3 EHI_000240A 876.83189 752.01378 1122.88829 1140.54489 1837.65493 2071.45616
## 4 EHI_000250A 492.50623 510.71341 232.49229 315.37794 310.74700 642.81736
## 5 EHI_000260A 12.81086 107.76521 2.11999 105.84602 63.71431 49.07003
## 6 EHI_000280A 58.36056 42.16900 171.71923 53.28303 79.36344 60.28603
## log2sample1 log2sample2 log2sample3 log2samplevsCDC51 log2samplevsCDC52
## 1 7.417259 8.687721 8.869952 6.201533 5.392236
## 2 8.425172 8.345008 5.279992 6.807708 7.192281
## 3 10.156772 10.844435 11.017126 9.777801 9.556532
## 4 8.305505 8.284232 9.330508 8.946924 8.999192
## 5 6.739389 6.016013 5.645875 3.787731 6.765073
## 6 5.762429 6.328467 5.937486 5.891433 5.431924
## log2samplevsCDC53
## 1 8.137224
## 2 9.332642
## 3 10.134283
## 4 7.867231
## 5 1.641542
## 6 7.432285
save.image('CheckPointTwo.RData')
setwd("~/Documents/GitHub/Resultados/docs/PrimeroDiffExpAllResults/Clasificando/Abundances")
#load('CheckPointTwo.RData')
library(ggplot2);library(dplyr);library("fitdistrplus");
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
## Loading required package: MASS
##
## Attaching package: 'MASS'
## The following object is masked from 'package:dplyr':
##
## select
## Loading required package: survival
library("MASS");library("survival")
head(data1)
## GenId CDC5_1 CDC5_2 CDC5_3 pEhEx_1 pEhEx_2 pEhEx_3
## 1 EHI_000130A 72.59485 40.99764 280.54541 169.92967 411.34855 466.86626
## 2 EHI_000140A 111.02742 145.24877 643.77044 342.73950 324.16054 37.85402
## 3 EHI_000240A 876.83189 752.01378 1122.88829 1140.54489 1837.65493 2071.45616
## 4 EHI_000250A 492.50623 510.71341 232.49229 315.37794 310.74700 642.81736
## 5 EHI_000260A 12.81086 107.76521 2.11999 105.84602 63.71431 49.07003
## 6 EHI_000280A 58.36056 42.16900 171.71923 53.28303 79.36344 60.28603
## log2sample1 log2sample2 log2sample3 log2samplevsCDC51 log2samplevsCDC52
## 1 7.417259 8.687721 8.869952 6.201533 5.392236
## 2 8.425172 8.345008 5.279992 6.807708 7.192281
## 3 10.156772 10.844435 11.017126 9.777801 9.556532
## 4 8.305505 8.284232 9.330508 8.946924 8.999192
## 5 6.739389 6.016013 5.645875 3.787731 6.765073
## 6 5.762429 6.328467 5.937486 5.891433 5.431924
## log2samplevsCDC53
## 1 8.137224
## 2 9.332642
## 3 10.134283
## 4 7.867231
## 5 1.641542
## 6 7.432285
log2sample1 <- data1$log2sample1; head(mean(log2sample1)); head(sd(log2sample1))
## [1] 6.30237
## [1] 2.868113
head(log2sample1,5)
## [1] 7.417259 8.425172 10.156772 8.305505 6.739389
summary(data1)
## GenId CDC5_1 CDC5_2 CDC5_3
## Length:4772 Min. : 0.00 Min. : 0.00 Min. : 0.0
## Class :character 1st Qu.: 17.08 1st Qu.: 17.57 1st Qu.: 16.3
## Mode :character Median : 45.55 Median : 49.20 Median : 44.5
## Mean : 1749.28 Mean : 1748.01 Mean : 1980.0
## 3rd Qu.: 196.79 3rd Qu.: 208.50 3rd Qu.: 177.4
## Max. :270953.87 Max. :270338.41 Max. :481876.0
## pEhEx_1 pEhEx_2 pEhEx_3 log2sample1
## Min. : 0.0 Min. : 0.00 Min. : 0.0 Min. : 0.000
## 1st Qu.: 18.0 1st Qu.: 15.65 1st Qu.: 15.4 1st Qu.: 4.248
## Median : 50.4 Median : 49.18 Median : 54.0 Median : 5.684
## Mean : 1395.0 Mean : 1717.64 Mean : 1909.2 Mean : 6.302
## 3rd Qu.: 208.1 3rd Qu.: 223.84 3rd Qu.: 242.0 3rd Qu.: 7.708
## Max. :207266.7 Max. :265749.05 Max. :707261.7 Max. :17.661
## log2sample2 log2sample3 log2samplevsCDC51 log2samplevsCDC52
## Min. : 0.000 Min. : 0.000 Min. : 0.000 Min. : 0.000
## 1st Qu.: 4.057 1st Qu.: 4.038 1st Qu.: 4.176 1st Qu.: 4.215
## Median : 5.649 Median : 5.781 Median : 5.541 Median : 5.650
## Mean : 6.237 Mean : 6.186 Mean : 6.244 Mean : 6.270
## 3rd Qu.: 7.813 3rd Qu.: 7.925 3rd Qu.: 7.628 3rd Qu.: 7.711
## Max. :18.020 Max. :19.432 Max. :18.048 Max. :18.044
## log2samplevsCDC53
## Min. : 0.000
## 1st Qu.: 4.109
## Median : 5.508
## Mean : 6.114
## 3rd Qu.: 7.479
## Max. :18.878
ndata1 <- length(log2sample1)
hist(log2sample1, breaks = nbreaks, col= rainbow(25,0.3),
main = 'Log2 sample1')
meanlog2sample1 <- mean(log2sample1); head(meanlog2sample1)
## [1] 6.30237
StdDevlog2sample1 <- sd(log2sample1); head(StdDevlog2sample1)
## [1] 2.868113
Normlog2sample1 <- (log2sample1-meanlog2sample1)/StdDevlog2sample1; head(Normlog2sample1)
## [1] 0.3887185 0.7401387 1.3438805 0.6984156 0.1523717 -0.1882564
tst<- Normlog2sample1
hist(tst, breaks = nbreaks, col= 1:5,
main = 'Normalized Log2sample1',
xlab='pEhEx1',
ylab= 'Frequency pEhEx')
fw1<-fitdist(tst, "norm")
plotdist(tst, histo = TRUE, demp = TRUE)
nnorm.f <- fitdist(tst,"norm")
summary(nnorm.f)
## Fitting of the distribution ' norm ' by maximum likelihood
## Parameters :
## estimate Std. Error
## mean -9.053474e-17 0.01447452
## sd 9.998952e-01 0.01023499
## Loglikelihood: -6770.675 AIC: 13545.35 BIC: 13558.29
## Correlation matrix:
## mean sd
## mean 1 0
## sd 0 1
par(mfrow=c(2,2))
denscomp(nnorm.f,legendtext = 'Dist Normal')
qqcomp(nnorm.f,legendtext = 'Dist Normal')
cdfcomp(nnorm.f,legendtext = 'Dist Normal')
ppcomp(nnorm.f,legendtext = 'Dist Normal')
probs <- c();
probs[8] = 0.175; probs[9] = 0.825;
probs[7] = 0.15; probs[10] = 0.85;
probs[6] = 0.125; probs[11] = 0.875;
probs[5] = 0.1; probs[12] = 0.9;
probs[4] = 0.075; probs[13] = 0.925;
probs[3] = 0.05; probs[14] = 0.95;
probs[2] = 0.025; probs[15] = 0.975;
probs[1] = 0.005; probs[16] = 0.995;
CuantilesData <- quantile(tst,prob = probs)
CuantilesModel <- qnorm(probs, mean=0, sd=1)
Cuantilillos <- t(CuantilesModel)
colnames(Cuantilillos) <- c('0.5%','2.5%','5%','7.5%',
'10%','12.5%','15%','17.5%',
'82.5%','85%','87.5%','90%',
'92.5%','95%','97.5%','99.5%')
Cuantilillos <- t(Cuantilillos)
colnames(Cuantilillos) <- c('Cuantiles Ajuste')
print(Cuantilillos)
## Cuantiles Ajuste
## 0.5% -2.5758293
## 2.5% -1.9599640
## 5% -1.6448536
## 7.5% -1.4395315
## 10% -1.2815516
## 12.5% -1.1503494
## 15% -1.0364334
## 17.5% -0.9345893
## 82.5% 0.9345893
## 85% 1.0364334
## 87.5% 1.1503494
## 90% 1.2815516
## 92.5% 1.4395315
## 95% 1.6448536
## 97.5% 1.9599640
## 99.5% 2.5758293
CĂ¡lculo de cuantiles
CuantilesA <- matrix(0,8,2)
CuantilesD <- matrix(0,8,2)
colnames(CuantilesA) <- c('LimInf','LimSup')
colnames(CuantilesD) <- c('LimInf','LimSup')
rownames(CuantilesA) <- c('65','70','75','80','85','90','95','99')
rownames(CuantilesD) <- c('65','70','75','80','85','90','95','99')
CuantilesA[1,1] <-CuantilesData[8]; CuantilesA[1,2] <-CuantilesData[9]
CuantilesA[2,1] <-CuantilesData[7]; CuantilesA[2,2] <-CuantilesData[10]
CuantilesA[3,1] <-CuantilesData[6]; CuantilesA[3,2] <-CuantilesData[11]
CuantilesA[4,1] <-CuantilesData[5]; CuantilesA[4,2] <-CuantilesData[12]
CuantilesA[5,1] <-CuantilesData[4]; CuantilesA[5,2] <-CuantilesData[13]
CuantilesA[6,1] <-CuantilesData[3]; CuantilesA[6,2] <-CuantilesData[14]
CuantilesA[7,1] <-CuantilesData[2]; CuantilesA[7,2] <-CuantilesData[15]
CuantilesA[8,1] <-CuantilesData[1]; CuantilesA[8,2] <-CuantilesData[16]
CuantilesD[1,1] <-Cuantilillos[8]; CuantilesD[1,2] <-Cuantilillos[9]
CuantilesD[2,1] <-Cuantilillos[7]; CuantilesD[2,2] <-Cuantilillos[10]
CuantilesD[3,1] <-Cuantilillos[6]; CuantilesD[3,2] <-Cuantilillos[11]
CuantilesD[4,1] <-Cuantilillos[5]; CuantilesD[4,2] <-Cuantilillos[12]
CuantilesD[5,1] <-Cuantilillos[4]; CuantilesD[5,2] <-Cuantilillos[13]
CuantilesD[6,1] <-Cuantilillos[3]; CuantilesD[6,2] <-Cuantilillos[14]
CuantilesD[7,1] <-Cuantilillos[2]; CuantilesD[7,2] <-Cuantilillos[15]
CuantilesD[8,1] <-Cuantilillos[1]; CuantilesD[8,2] <-Cuantilillos[16]
print(CuantilesD)
## LimInf LimSup
## 65 -0.9345893 0.9345893
## 70 -1.0364334 1.0364334
## 75 -1.1503494 1.1503494
## 80 -1.2815516 1.2815516
## 85 -1.4395315 1.4395315
## 90 -1.6448536 1.6448536
## 95 -1.9599640 1.9599640
## 99 -2.5758293 2.5758293
print(CuantilesA)
## LimInf LimSup
## 65 -0.8713278 0.8126272
## 70 -0.9260903 0.9617987
## 75 -0.9875514 1.1301158
## 80 -1.0213487 1.3734820
## 85 -1.0966280 1.6988689
## 90 -1.1851905 2.1819106
## 95 -1.3565981 2.6079805
## 99 -1.9245847 3.1666752
col_sequence <- rainbow(n = 7, alpha = 0.35, start = 0, end = 1)
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 pEhEx - DATA', lty = 9)
abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesA[2,2], lty=2, col="darkblue") # 70% SUPERIOR
abline(v=CuantilesA[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesA[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesA[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesA[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesA[6,1], lty=2, col="red"); # 90% INFERIOR
abline(v=CuantilesA[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesA[7,1], lty=2, col="blue"); # 95% INFERIOR
abline(v=CuantilesA[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesA[8,1], lty=2, col="orange"); # 99% INFERIOR
abline(v=CuantilesA[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
legend=c("65%","70%","75%","80%","85%","90%","95%","99%"),
pch=c(1,2,3,4,5,6,7,8),
col=c("darkgoldenrod4","darkblue","aquamarine4",
"green", "brown","red","blue","orange"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 pEhEx - ADJUSTED', lty=9)
abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesD[2,2], lty=2, col="darkblue"); # 70% SUPERIOR
abline(v=CuantilesD[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesD[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesD[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesD[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesD[6,1], lty=2, col="red"); # 90% INFERIOR
abline(v=CuantilesD[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesD[7,1], lty=2, col="blue"); # 95% INFERIOR
abline(v=CuantilesD[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesD[8,1], lty=2, col="orange"); # 99% INFERIOR
abline(v=CuantilesD[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
legend=c("65%","70%","75%","80%","85%","90%","95%","99%"),
pch=c(1,2,3,4,5,6,7,8),
col=c("darkgoldenrod4","darkblue","aquamarine4",
"green", "brown","red","blue","orange"))
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 pEhEx - DATA', lty=9)
abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"),
pch=c(1,2),col=c("darkgoldenrod4","green"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 BaseMean - ADJUSTED', lty=9)
abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"),
pch=c(1,2),col=c("darkgoldenrod4","green"))
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 pEhEx - DATA', lty=9)
abline(v=CuantilesA[2,1], lty=2, col="darkblue");
abline(v=CuantilesA[2,2], lty=2, col="darkblue")
abline(v=CuantilesA[5,1], lty=2, col="brown");
abline(v=CuantilesA[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
pch=c(1,2),#3,4,5,6,7,8),
col=c("brown"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 pEhEx - ADJUSTED', lty=9)
abline(v=CuantilesD[2,1], lty=2, col="darkblue");
abline(v=CuantilesD[2,2], lty=2, col="darkblue")
abline(v=CuantilesD[5,1], lty=2, col="brown");
abline(v=CuantilesD[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
pch=c(1,2),#3,4,5,6,7,8),
col=c("brown"))
log2sample2 <- data1$log2sample2; head(mean(log2sample2)); head(sd(log2sample2))
## [1] 6.237216
## [1] 3.103083
head(log2sample2,5)
## [1] 8.687721 8.345008 10.844435 8.284232 6.016013
ndata1 <- length(log2sample2)
hist(log2sample2, breaks = nbreaks, col= rainbow(25,0.3),
main = 'Log2 sample2')
Log-normalizacion
meanlog2sample2 <- mean(log2sample2); head(meanlog2sample2)
## [1] 6.237216
StdDevlog2sample2 <- sd(log2sample2); head(StdDevlog2sample2)
## [1] 3.103083
Normlog2sample2 <- (log2sample2-meanlog2sample2)/StdDevlog2sample2; head(Normlog2sample2)
## [1] 0.78969998 0.67925752 1.48472313 0.65967167 -0.07128491 0.02940674
tst<- Normlog2sample2
hist(tst, breaks = nbreaks, col= 1:5,
main = 'Normalized Log2sample1',
xlab='pEhEx1',
ylab= 'Frequency pEhEx')
Ajuste de modelo
fw1<-fitdist(tst, "norm")
plotdist(tst, histo = TRUE, demp = TRUE)
nnorm.f <- fitdist(tst,"norm")
summary(nnorm.f)
## Fitting of the distribution ' norm ' by maximum likelihood
## Parameters :
## estimate Std. Error
## mean -1.260395e-16 0.01447452
## sd 9.998952e-01 0.01023499
## Loglikelihood: -6770.675 AIC: 13545.35 BIC: 13558.29
## Correlation matrix:
## mean sd
## mean 1 0
## sd 0 1
par(mfrow=c(2,2))
denscomp(nnorm.f,legendtext = 'Dist Normal')
qqcomp(nnorm.f,legendtext = 'Dist Normal')
cdfcomp(nnorm.f,legendtext = 'Dist Normal')
ppcomp(nnorm.f,legendtext = 'Dist Normal')
probs <- c();
probs[8] = 0.175; probs[9] = 0.825;
probs[7] = 0.15; probs[10] = 0.85;
probs[6] = 0.125; probs[11] = 0.875;
probs[5] = 0.1; probs[12] = 0.9;
probs[4] = 0.075; probs[13] = 0.925;
probs[3] = 0.05; probs[14] = 0.95;
probs[2] = 0.025; probs[15] = 0.975;
probs[1] = 0.005; probs[16] = 0.995;
CuantilesData <- quantile(tst,prob = probs)
CuantilesModel <- qnorm(probs, mean=0, sd=1)
Cuantilillos <- t(CuantilesModel)
colnames(Cuantilillos) <- c('0.5%','2.5%','5%','7.5%',
'10%','12.5%','15%','17.5%',
'82.5%','85%','87.5%','90%',
'92.5%','95%','97.5%','99.5%')
Cuantilillos <- t(Cuantilillos)
colnames(Cuantilillos) <- c('Cuantiles Ajuste')
print(Cuantilillos)
## Cuantiles Ajuste
## 0.5% -2.5758293
## 2.5% -1.9599640
## 5% -1.6448536
## 7.5% -1.4395315
## 10% -1.2815516
## 12.5% -1.1503494
## 15% -1.0364334
## 17.5% -0.9345893
## 82.5% 0.9345893
## 85% 1.0364334
## 87.5% 1.1503494
## 90% 1.2815516
## 92.5% 1.4395315
## 95% 1.6448536
## 97.5% 1.9599640
## 99.5% 2.5758293
CuantilesA <- matrix(0,8,2)
CuantilesD <- matrix(0,8,2)
colnames(CuantilesA) <- c('LimInf','LimSup')
colnames(CuantilesD) <- c('LimInf','LimSup')
rownames(CuantilesA) <- c('65','70','75','80','85','90','95','99')
rownames(CuantilesD) <- c('65','70','75','80','85','90','95','99')
CuantilesA[1,1] <-CuantilesData[8]; CuantilesA[1,2] <-CuantilesData[9]
CuantilesA[2,1] <-CuantilesData[7]; CuantilesA[2,2] <-CuantilesData[10]
CuantilesA[3,1] <-CuantilesData[6]; CuantilesA[3,2] <-CuantilesData[11]
CuantilesA[4,1] <-CuantilesData[5]; CuantilesA[4,2] <-CuantilesData[12]
CuantilesA[5,1] <-CuantilesData[4]; CuantilesA[5,2] <-CuantilesData[13]
CuantilesA[6,1] <-CuantilesData[3]; CuantilesA[6,2] <-CuantilesData[14]
CuantilesA[7,1] <-CuantilesData[2]; CuantilesA[7,2] <-CuantilesData[15]
CuantilesA[8,1] <-CuantilesData[1]; CuantilesA[8,2] <-CuantilesData[16]
CuantilesD[1,1] <-Cuantilillos[8]; CuantilesD[1,2] <-Cuantilillos[9]
CuantilesD[2,1] <-Cuantilillos[7]; CuantilesD[2,2] <-Cuantilillos[10]
CuantilesD[3,1] <-Cuantilillos[6]; CuantilesD[3,2] <-Cuantilillos[11]
CuantilesD[4,1] <-Cuantilillos[5]; CuantilesD[4,2] <-Cuantilillos[12]
CuantilesD[5,1] <-Cuantilillos[4]; CuantilesD[5,2] <-Cuantilillos[13]
CuantilesD[6,1] <-Cuantilillos[3]; CuantilesD[6,2] <-Cuantilillos[14]
CuantilesD[7,1] <-Cuantilillos[2]; CuantilesD[7,2] <-Cuantilillos[15]
CuantilesD[8,1] <-Cuantilillos[1]; CuantilesD[8,2] <-Cuantilillos[16]
print(CuantilesD)
## LimInf LimSup
## 65 -0.9345893 0.9345893
## 70 -1.0364334 1.0364334
## 75 -1.1503494 1.1503494
## 80 -1.2815516 1.2815516
## 85 -1.4395315 1.4395315
## 90 -1.6448536 1.6448536
## 95 -1.9599640 1.9599640
## 99 -2.5758293 2.5758293
print(CuantilesA)
## LimInf LimSup
## 65 -0.8926336 0.8466541
## 70 -0.9421687 0.9875692
## 75 -0.9976178 1.1428700
## 80 -1.0605870 1.3752461
## 85 -1.1334411 1.6895575
## 90 -1.2198720 2.1202686
## 95 -1.4640882 2.5136403
## 99 -2.0100061 3.0865078
col_sequence <- rainbow(n = 7, alpha = 0.35, start = 0, end = 1)
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 pEhEx - DATA (sample 2)', lty = 9)
abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesA[2,2], lty=2, col="darkblue") # 70% SUPERIOR
abline(v=CuantilesA[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesA[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesA[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesA[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesA[6,1], lty=2, col="red"); # 90% INFERIOR
abline(v=CuantilesA[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesA[7,1], lty=2, col="blue"); # 95% INFERIOR
abline(v=CuantilesA[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesA[8,1], lty=2, col="orange"); # 99% INFERIOR
abline(v=CuantilesA[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
legend=c("65%","70%","75%","80%","85%","90%","95%","99%"),
pch=c(1,2,3,4,5,6,7,8),
col=c("darkgoldenrod4","darkblue","aquamarine4",
"green", "brown","red","blue","orange"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 pEhEx - ADJUSTED (sample 2)', lty=9)
abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesD[2,2], lty=2, col="darkblue"); # 70% SUPERIOR
abline(v=CuantilesD[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesD[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesD[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesD[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesD[6,1], lty=2, col="red"); # 90% INFERIOR
abline(v=CuantilesD[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesD[7,1], lty=2, col="blue"); # 95% INFERIOR
abline(v=CuantilesD[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesD[8,1], lty=2, col="orange"); # 99% INFERIOR
abline(v=CuantilesD[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
legend=c("65%","70%","75%","80%","85%","90%","95%","99%"),
pch=c(1,2,3,4,5,6,7,8),
col=c("darkgoldenrod4","darkblue","aquamarine4",
"green", "brown","red","blue","orange"))
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 pEhEx - DATA (sample 2)', lty=9)
abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"),
pch=c(1,2),col=c("darkgoldenrod4","green"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 BaseMean - ADJUSTED (sample 2)', lty=9)
abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"),
pch=c(1,2),col=c("darkgoldenrod4","green"))
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 pEhEx - DATA (sample 2)', lty=9)
abline(v=CuantilesA[2,1], lty=2, col="darkblue");
abline(v=CuantilesA[2,2], lty=2, col="darkblue")
abline(v=CuantilesA[5,1], lty=2, col="brown");
abline(v=CuantilesA[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
pch=c(1,2),#3,4,5,6,7,8),
col=c("brown"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 pEhEx - ADJUSTED (sample 2)', lty=9)
abline(v=CuantilesD[2,1], lty=2, col="darkblue");
abline(v=CuantilesD[2,2], lty=2, col="darkblue")
abline(v=CuantilesD[5,1], lty=2, col="brown");
abline(v=CuantilesD[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
pch=c(1,2),#3,4,5,6,7,8),
col=c("brown"))
log2sample3 <- data1$log2sample3; head(mean(log2sample3)); head(sd(log2sample3))
## [1] 6.186357
## [1] 3.171257
head(log2sample3,5)
## [1] 8.869952 5.279992 11.017126 9.330508 5.645875
ndata1 <- length(log2sample3)
hist(log2sample3, breaks = nbreaks, col= rainbow(25,0.3),
main = 'Log2 sample2')
meanlog2sample3 <- mean(log2sample3); head(meanlog2sample3)
## [1] 6.186357
StdDevlog2sample3 <- sd(log2sample3); head(StdDevlog2sample3)
## [1] 3.171257
Normlog2sample3 <- (log2sample3-meanlog2sample3)/StdDevlog2sample3; head(Normlog2sample3)
## [1] 0.84622446 -0.28580629 1.52329778 0.99145245 -0.17043143 -0.07847701
tst<- Normlog2sample3
hist(tst, breaks = nbreaks, col= 1:5,
main = 'Normalized Log2sample1',
xlab='pEhEx1',
ylab= 'Frequency pEhEx')
Ajustando Modelos
fw1<-fitdist(tst, "norm")
plotdist(tst, histo = TRUE, demp = TRUE)
nnorm.f <- fitdist(tst,"norm")
summary(nnorm.f)
## Fitting of the distribution ' norm ' by maximum likelihood
## Parameters :
## estimate Std. Error
## mean 2.945427e-17 0.01447452
## sd 9.998952e-01 0.01023499
## Loglikelihood: -6770.675 AIC: 13545.35 BIC: 13558.29
## Correlation matrix:
## mean sd
## mean 1.000000e+00 1.684231e-11
## sd 1.684231e-11 1.000000e+00
par(mfrow=c(2,2))
denscomp(nnorm.f,legendtext = 'Dist Normal')
qqcomp(nnorm.f,legendtext = 'Dist Normal')
cdfcomp(nnorm.f,legendtext = 'Dist Normal')
ppcomp(nnorm.f,legendtext = 'Dist Normal')
probs <- c();
probs[8] = 0.175; probs[9] = 0.825;
probs[7] = 0.15; probs[10] = 0.85;
probs[6] = 0.125; probs[11] = 0.875;
probs[5] = 0.1; probs[12] = 0.9;
probs[4] = 0.075; probs[13] = 0.925;
probs[3] = 0.05; probs[14] = 0.95;
probs[2] = 0.025; probs[15] = 0.975;
probs[1] = 0.005; probs[16] = 0.995;
CuantilesData <- quantile(tst,prob = probs)
CuantilesModel <- qnorm(probs, mean=0, sd=1)
Cuantilillos <- t(CuantilesModel)
colnames(Cuantilillos) <- c('0.5%','2.5%','5%','7.5%',
'10%','12.5%','15%','17.5%',
'82.5%','85%','87.5%','90%',
'92.5%','95%','97.5%','99.5%')
Cuantilillos <- t(Cuantilillos)
colnames(Cuantilillos) <- c('Cuantiles Ajuste')
print(Cuantilillos)
## Cuantiles Ajuste
## 0.5% -2.5758293
## 2.5% -1.9599640
## 5% -1.6448536
## 7.5% -1.4395315
## 10% -1.2815516
## 12.5% -1.1503494
## 15% -1.0364334
## 17.5% -0.9345893
## 82.5% 0.9345893
## 85% 1.0364334
## 87.5% 1.1503494
## 90% 1.2815516
## 92.5% 1.4395315
## 95% 1.6448536
## 97.5% 1.9599640
## 99.5% 2.5758293
CuantilesA <- matrix(0,8,2)
CuantilesD <- matrix(0,8,2)
colnames(CuantilesA) <- c('LimInf','LimSup')
colnames(CuantilesD) <- c('LimInf','LimSup')
rownames(CuantilesA) <- c('65','70','75','80','85','90','95','99')
rownames(CuantilesD) <- c('65','70','75','80','85','90','95','99')
CuantilesA[1,1] <-CuantilesData[8]; CuantilesA[1,2] <-CuantilesData[9]
CuantilesA[2,1] <-CuantilesData[7]; CuantilesA[2,2] <-CuantilesData[10]
CuantilesA[3,1] <-CuantilesData[6]; CuantilesA[3,2] <-CuantilesData[11]
CuantilesA[4,1] <-CuantilesData[5]; CuantilesA[4,2] <-CuantilesData[12]
CuantilesA[5,1] <-CuantilesData[4]; CuantilesA[5,2] <-CuantilesData[13]
CuantilesA[6,1] <-CuantilesData[3]; CuantilesA[6,2] <-CuantilesData[14]
CuantilesA[7,1] <-CuantilesData[2]; CuantilesA[7,2] <-CuantilesData[15]
CuantilesA[8,1] <-CuantilesData[1]; CuantilesA[8,2] <-CuantilesData[16]
CuantilesD[1,1] <-Cuantilillos[8]; CuantilesD[1,2] <-Cuantilillos[9]
CuantilesD[2,1] <-Cuantilillos[7]; CuantilesD[2,2] <-Cuantilillos[10]
CuantilesD[3,1] <-Cuantilillos[6]; CuantilesD[3,2] <-Cuantilillos[11]
CuantilesD[4,1] <-Cuantilillos[5]; CuantilesD[4,2] <-Cuantilillos[12]
CuantilesD[5,1] <-Cuantilillos[4]; CuantilesD[5,2] <-Cuantilillos[13]
CuantilesD[6,1] <-Cuantilillos[3]; CuantilesD[6,2] <-Cuantilillos[14]
CuantilesD[7,1] <-Cuantilillos[2]; CuantilesD[7,2] <-Cuantilillos[15]
CuantilesD[8,1] <-Cuantilillos[1]; CuantilesD[8,2] <-Cuantilillos[16]
print(CuantilesD)
## LimInf LimSup
## 65 -0.9345893 0.9345893
## 70 -1.0364334 1.0364334
## 75 -1.1503494 1.1503494
## 80 -1.2815516 1.2815516
## 85 -1.4395315 1.4395315
## 90 -1.6448536 1.6448536
## 95 -1.9599640 1.9599640
## 99 -2.5758293 2.5758293
print(CuantilesA)
## LimInf LimSup
## 65 -0.8676459 0.8379706
## 70 -0.9660265 0.9701830
## 75 -1.0458574 1.1161493
## 80 -1.1427428 1.3265284
## 85 -1.2660057 1.6213606
## 90 -1.4356115 2.0178765
## 95 -1.7090932 2.4795401
## 99 -1.9507587 3.0829063
CreaciĂ³n de histogramas
col_sequence <- rainbow(n = 7, alpha = 0.35, start = 0, end = 1)
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 pEhEx - DATA (sample 3)', lty = 9)
abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesA[2,2], lty=2, col="darkblue") # 70% SUPERIOR
abline(v=CuantilesA[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesA[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesA[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesA[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesA[6,1], lty=2, col="red"); # 90% INFERIOR
abline(v=CuantilesA[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesA[7,1], lty=2, col="blue"); # 95% INFERIOR
abline(v=CuantilesA[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesA[8,1], lty=2, col="orange"); # 99% INFERIOR
abline(v=CuantilesA[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
legend=c("65%","70%","75%","80%","85%","90%","95%","99%"),
pch=c(1,2,3,4,5,6,7,8),
col=c("darkgoldenrod4","darkblue","aquamarine4",
"green", "brown","red","blue","orange"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 pEhEx - ADJUSTED (sample 3)', lty=9)
abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesD[2,2], lty=2, col="darkblue"); # 70% SUPERIOR
abline(v=CuantilesD[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesD[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesD[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesD[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesD[6,1], lty=2, col="red"); # 90% INFERIOR
abline(v=CuantilesD[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesD[7,1], lty=2, col="blue"); # 95% INFERIOR
abline(v=CuantilesD[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesD[8,1], lty=2, col="orange"); # 99% INFERIOR
abline(v=CuantilesD[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
legend=c("65%","70%","75%","80%","85%","90%","95%","99%"),
pch=c(1,2,3,4,5,6,7,8),
col=c("darkgoldenrod4","darkblue","aquamarine4",
"green", "brown","red","blue","orange"))
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 pEhEx - DATA (sample 2)', lty=9)
abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"),
pch=c(1,2),col=c("darkgoldenrod4","green"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 BaseMean - ADJUSTED (sample 3)', lty=9)
abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"),
pch=c(1,2),col=c("darkgoldenrod4","green"))
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 pEhEx - DATA (sample 3)', lty=9)
abline(v=CuantilesA[2,1], lty=2, col="darkblue");
abline(v=CuantilesA[2,2], lty=2, col="darkblue")
abline(v=CuantilesA[5,1], lty=2, col="brown");
abline(v=CuantilesA[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
pch=c(1,2),#3,4,5,6,7,8),
col=c("brown"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2 pEhEx - ADJUSTED (sample 3)', lty=9)
abline(v=CuantilesD[2,1], lty=2, col="darkblue");
abline(v=CuantilesD[2,2], lty=2, col="darkblue")
abline(v=CuantilesD[5,1], lty=2, col="brown");
abline(v=CuantilesD[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
pch=c(1,2),#3,4,5,6,7,8),
col=c("brown"))
log2vsCDC51 <- data1$log2samplevsCDC51; head(mean(log2vsCDC51)); head(sd(log2vsCDC51))
## [1] 6.244372
## [1] 2.880412
head(log2vsCDC51,5)
## [1] 6.201533 6.807708 9.777801 8.946924 3.787731
ndata1 <- length(log2vsCDC51)
hist(log2vsCDC51, breaks = nbreaks, col= rainbow(25,0.3),
main = 'Log2vsCDC51')
meanlog2vsCDC51 <- mean(log2vsCDC51); head(meanlog2vsCDC51)
## [1] 6.244372
StdDevlog2vsCDC51 <- sd(log2vsCDC51); head(StdDevlog2vsCDC51)
## [1] 2.880412
Normlog2vsCDC51 <- (log2vsCDC51-meanlog2vsCDC51)/StdDevlog2vsCDC51; head(Normlog2vsCDC51)
## [1] -0.01487273 0.19557464 1.22670936 0.93825188 -0.85287855 -0.12253093
tst<- Normlog2vsCDC51
Primer histograma
hist(tst, breaks = nbreaks, col= 1:5,
main = 'Normalized Log2vsCDC51',
xlab='pEhEx1',
ylab= 'Frequency pEhEx')
Ajustando modelo
fw1<-fitdist(tst, "norm")
plotdist(tst, histo = TRUE, demp = TRUE)
nnorm.f <- fitdist(tst,"norm")
summary(nnorm.f)
## Fitting of the distribution ' norm ' by maximum likelihood
## Parameters :
## estimate Std. Error
## mean 6.276949e-17 0.01447452
## sd 9.998952e-01 0.01023499
## Loglikelihood: -6770.675 AIC: 13545.35 BIC: 13558.29
## Correlation matrix:
## mean sd
## mean 1 0
## sd 0 1
par(mfrow=c(2,2))
denscomp(nnorm.f,legendtext = 'Dist Normal')
qqcomp(nnorm.f,legendtext = 'Dist Normal')
cdfcomp(nnorm.f,legendtext = 'Dist Normal')
ppcomp(nnorm.f,legendtext = 'Dist Normal')
probs <- c();
probs[8] = 0.175; probs[9] = 0.825;
probs[7] = 0.15; probs[10] = 0.85;
probs[6] = 0.125; probs[11] = 0.875;
probs[5] = 0.1; probs[12] = 0.9;
probs[4] = 0.075; probs[13] = 0.925;
probs[3] = 0.05; probs[14] = 0.95;
probs[2] = 0.025; probs[15] = 0.975;
probs[1] = 0.005; probs[16] = 0.995;
CuantilesData <- quantile(tst,prob = probs)
CuantilesModel <- qnorm(probs, mean=0, sd=1)
Cuantilillos <- t(CuantilesModel)
colnames(Cuantilillos) <- c('0.5%','2.5%','5%','7.5%',
'10%','12.5%','15%','17.5%',
'82.5%','85%','87.5%','90%',
'92.5%','95%','97.5%','99.5%')
Cuantilillos <- t(Cuantilillos)
colnames(Cuantilillos) <- c('Cuantiles Ajuste')
print(Cuantilillos)
## Cuantiles Ajuste
## 0.5% -2.5758293
## 2.5% -1.9599640
## 5% -1.6448536
## 7.5% -1.4395315
## 10% -1.2815516
## 12.5% -1.1503494
## 15% -1.0364334
## 17.5% -0.9345893
## 82.5% 0.9345893
## 85% 1.0364334
## 87.5% 1.1503494
## 90% 1.2815516
## 92.5% 1.4395315
## 95% 1.6448536
## 97.5% 1.9599640
## 99.5% 2.5758293
CuantilesA <- matrix(0,8,2)
CuantilesD <- matrix(0,8,2)
colnames(CuantilesA) <- c('LimInf','LimSup')
colnames(CuantilesD) <- c('LimInf','LimSup')
rownames(CuantilesA) <- c('65','70','75','80','85','90','95','99')
rownames(CuantilesD) <- c('65','70','75','80','85','90','95','99')
CuantilesA[1,1] <-CuantilesData[8]; CuantilesA[1,2] <-CuantilesData[9]
CuantilesA[2,1] <-CuantilesData[7]; CuantilesA[2,2] <-CuantilesData[10]
CuantilesA[3,1] <-CuantilesData[6]; CuantilesA[3,2] <-CuantilesData[11]
CuantilesA[4,1] <-CuantilesData[5]; CuantilesA[4,2] <-CuantilesData[12]
CuantilesA[5,1] <-CuantilesData[4]; CuantilesA[5,2] <-CuantilesData[13]
CuantilesA[6,1] <-CuantilesData[3]; CuantilesA[6,2] <-CuantilesData[14]
CuantilesA[7,1] <-CuantilesData[2]; CuantilesA[7,2] <-CuantilesData[15]
CuantilesA[8,1] <-CuantilesData[1]; CuantilesA[8,2] <-CuantilesData[16]
CuantilesD[1,1] <-Cuantilillos[8]; CuantilesD[1,2] <-Cuantilillos[9]
CuantilesD[2,1] <-Cuantilillos[7]; CuantilesD[2,2] <-Cuantilillos[10]
CuantilesD[3,1] <-Cuantilillos[6]; CuantilesD[3,2] <-Cuantilillos[11]
CuantilesD[4,1] <-Cuantilillos[5]; CuantilesD[4,2] <-Cuantilillos[12]
CuantilesD[5,1] <-Cuantilillos[4]; CuantilesD[5,2] <-Cuantilillos[13]
CuantilesD[6,1] <-Cuantilillos[3]; CuantilesD[6,2] <-Cuantilillos[14]
CuantilesD[7,1] <-Cuantilillos[2]; CuantilesD[7,2] <-Cuantilillos[15]
CuantilesD[8,1] <-Cuantilillos[1]; CuantilesD[8,2] <-Cuantilillos[16]
print(CuantilesD)
## LimInf LimSup
## 65 -0.9345893 0.9345893
## 70 -1.0364334 1.0364334
## 75 -1.1503494 1.1503494
## 80 -1.2815516 1.2815516
## 85 -1.4395315 1.4395315
## 90 -1.6448536 1.6448536
## 95 -1.9599640 1.9599640
## 99 -2.5758293 2.5758293
print(CuantilesA)
## LimInf LimSup
## 65 -0.8528786 0.8216616
## 70 -0.9073590 0.9496778
## 75 -0.9073590 1.1007491
## 80 -0.9684970 1.3308952
## 85 -1.0381490 1.6867728
## 90 -1.1190762 2.1306178
## 95 -1.2156475 2.6928135
## 99 -2.1678747 3.3316192
Histogramas
col_sequence <- rainbow(n = 7, alpha = 0.35, start = 0, end = 1)
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC51 pEhEx - DATA', lty = 9)
abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesA[2,2], lty=2, col="darkblue") # 70% SUPERIOR
abline(v=CuantilesA[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesA[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesA[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesA[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesA[6,1], lty=2, col="red"); # 90% INFERIOR
abline(v=CuantilesA[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesA[7,1], lty=2, col="blue"); # 95% INFERIOR
abline(v=CuantilesA[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesA[8,1], lty=2, col="orange"); # 99% INFERIOR
abline(v=CuantilesA[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
legend=c("65%","70%","75%","80%","85%","90%","95%","99%"),
pch=c(1,2,3,4,5,6,7,8),
col=c("darkgoldenrod4","darkblue","aquamarine4",
"green", "brown","red","blue","orange"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC51 pEhEx - ADJUSTED', lty=9)
abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesD[2,2], lty=2, col="darkblue"); # 70% SUPERIOR
abline(v=CuantilesD[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesD[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesD[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesD[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesD[6,1], lty=2, col="red"); # 90% INFERIOR
abline(v=CuantilesD[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesD[7,1], lty=2, col="blue"); # 95% INFERIOR
abline(v=CuantilesD[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesD[8,1], lty=2, col="orange"); # 99% INFERIOR
abline(v=CuantilesD[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
legend=c("65%","70%","75%","80%","85%","90%","95%","99%"),
pch=c(1,2,3,4,5,6,7,8),
col=c("darkgoldenrod4","darkblue","aquamarine4",
"green", "brown","red","blue","orange"))
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC51 pEhEx - DATA', lty=9)
abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"),
pch=c(1,2),col=c("darkgoldenrod4","green"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC51 - ADJUSTED', lty=9)
abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"),
pch=c(1,2),col=c("darkgoldenrod4","green"))
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC51 pEhEx - DATA', lty=9)
abline(v=CuantilesA[2,1], lty=2, col="darkblue");
abline(v=CuantilesA[2,2], lty=2, col="darkblue")
abline(v=CuantilesA[5,1], lty=2, col="brown");
abline(v=CuantilesA[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
pch=c(1,2),#3,4,5,6,7,8),
col=c("brown"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC51 pEhEx - ADJUSTED', lty=9)
abline(v=CuantilesD[2,1], lty=2, col="darkblue");
abline(v=CuantilesD[2,2], lty=2, col="darkblue")
abline(v=CuantilesD[5,1], lty=2, col="brown");
abline(v=CuantilesD[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
pch=c(1,2),#3,4,5,6,7,8),
col=c("brown"))
log2vsCDC52 <- data1$log2samplevsCDC52; head(mean(log2vsCDC52)); head(sd(log2vsCDC52))
## [1] 6.269726
## [1] 2.952289
head(log2vsCDC52,5)
## [1] 5.392236 7.192281 9.556532 8.999192 6.765073
Primer Histograma
ndata1 <- length(log2vsCDC52)
hist(log2vsCDC52, breaks = nbreaks, col= rainbow(25,0.3),
main = 'Log2vsCDC52')
meanlog2vsCDC52 <- mean(log2vsCDC52); head(meanlog2vsCDC52)
## [1] 6.269726
StdDevlog2vsCDC52 <- sd(log2vsCDC52); head(StdDevlog2vsCDC52)
## [1] 2.952289
Normlog2vsCDC52 <- (log2vsCDC52-meanlog2vsCDC52)/StdDevlog2vsCDC52; head(Normlog2vsCDC52)
## [1] -0.2972235 0.3124880 1.1133080 0.9245256 0.1677843 -0.2837806
tst<- Normlog2vsCDC52
** Segundo Histograma**
hist(tst, breaks = nbreaks, col= 1:5,
main = 'Normalized Log2vsCDC52',
xlab='pEhEx1',
ylab= 'Frequency pEhEx')
Ajustando modelo
fw1<-fitdist(tst, "norm")
plotdist(tst, histo = TRUE, demp = TRUE)
nnorm.f <- fitdist(tst,"norm")
summary(nnorm.f)
## Fitting of the distribution ' norm ' by maximum likelihood
## Parameters :
## estimate Std. Error
## mean -3.587454e-18 0.01447452
## sd 9.998952e-01 0.01023499
## Loglikelihood: -6770.675 AIC: 13545.35 BIC: 13558.29
## Correlation matrix:
## mean sd
## mean 1.000000e+00 1.684231e-11
## sd 1.684231e-11 1.000000e+00
par(mfrow=c(2,2))
denscomp(nnorm.f,legendtext = 'Dist Normal')
qqcomp(nnorm.f,legendtext = 'Dist Normal')
cdfcomp(nnorm.f,legendtext = 'Dist Normal')
ppcomp(nnorm.f,legendtext = 'Dist Normal')
CĂ¡lculo de cuantiles
probs <- c();
probs[8] = 0.175; probs[9] = 0.825;
probs[7] = 0.15; probs[10] = 0.85;
probs[6] = 0.125; probs[11] = 0.875;
probs[5] = 0.1; probs[12] = 0.9;
probs[4] = 0.075; probs[13] = 0.925;
probs[3] = 0.05; probs[14] = 0.95;
probs[2] = 0.025; probs[15] = 0.975;
probs[1] = 0.005; probs[16] = 0.995;
CuantilesData <- quantile(tst,prob = probs)
CuantilesModel <- qnorm(probs, mean=0, sd=1)
Cuantilillos <- t(CuantilesModel)
colnames(Cuantilillos) <- c('0.5%','2.5%','5%','7.5%',
'10%','12.5%','15%','17.5%',
'82.5%','85%','87.5%','90%',
'92.5%','95%','97.5%','99.5%')
Cuantilillos <- t(Cuantilillos)
colnames(Cuantilillos) <- c('Cuantiles Ajuste')
print(Cuantilillos)
## Cuantiles Ajuste
## 0.5% -2.5758293
## 2.5% -1.9599640
## 5% -1.6448536
## 7.5% -1.4395315
## 10% -1.2815516
## 12.5% -1.1503494
## 15% -1.0364334
## 17.5% -0.9345893
## 82.5% 0.9345893
## 85% 1.0364334
## 87.5% 1.1503494
## 90% 1.2815516
## 92.5% 1.4395315
## 95% 1.6448536
## 97.5% 1.9599640
## 99.5% 2.5758293
CuantilesA <- matrix(0,8,2)
CuantilesD <- matrix(0,8,2)
colnames(CuantilesA) <- c('LimInf','LimSup')
colnames(CuantilesD) <- c('LimInf','LimSup')
rownames(CuantilesA) <- c('65','70','75','80','85','90','95','99')
rownames(CuantilesD) <- c('65','70','75','80','85','90','95','99')
CuantilesA[1,1] <-CuantilesData[8]; CuantilesA[1,2] <-CuantilesData[9]
CuantilesA[2,1] <-CuantilesData[7]; CuantilesA[2,2] <-CuantilesData[10]
CuantilesA[3,1] <-CuantilesData[6]; CuantilesA[3,2] <-CuantilesData[11]
CuantilesA[4,1] <-CuantilesData[5]; CuantilesA[4,2] <-CuantilesData[12]
CuantilesA[5,1] <-CuantilesData[4]; CuantilesA[5,2] <-CuantilesData[13]
CuantilesA[6,1] <-CuantilesData[3]; CuantilesA[6,2] <-CuantilesData[14]
CuantilesA[7,1] <-CuantilesData[2]; CuantilesA[7,2] <-CuantilesData[15]
CuantilesA[8,1] <-CuantilesData[1]; CuantilesA[8,2] <-CuantilesData[16]
CuantilesD[1,1] <-Cuantilillos[8]; CuantilesD[1,2] <-Cuantilillos[9]
CuantilesD[2,1] <-Cuantilillos[7]; CuantilesD[2,2] <-Cuantilillos[10]
CuantilesD[3,1] <-Cuantilillos[6]; CuantilesD[3,2] <-Cuantilillos[11]
CuantilesD[4,1] <-Cuantilillos[5]; CuantilesD[4,2] <-Cuantilillos[12]
CuantilesD[5,1] <-Cuantilillos[4]; CuantilesD[5,2] <-Cuantilillos[13]
CuantilesD[6,1] <-Cuantilillos[3]; CuantilesD[6,2] <-Cuantilillos[14]
CuantilesD[7,1] <-Cuantilillos[2]; CuantilesD[7,2] <-Cuantilillos[15]
CuantilesD[8,1] <-Cuantilillos[1]; CuantilesD[8,2] <-Cuantilillos[16]
print(CuantilesD)
## LimInf LimSup
## 65 -0.9345893 0.9345893
## 70 -1.0364334 1.0364334
## 75 -1.1503494 1.1503494
## 80 -1.2815516 1.2815516
## 85 -1.4395315 1.4395315
## 90 -1.6448536 1.6448536
## 95 -1.9599640 1.9599640
## 99 -2.5758293 2.5758293
print(CuantilesA)
## LimInf LimSup
## 65 -0.8380866 0.7932340
## 70 -0.8811551 0.9359679
## 75 -0.9283894 1.1117853
## 80 -1.0392501 1.3412158
## 85 -1.1058050 1.6629743
## 90 -1.1828753 2.0953140
## 95 -1.3871587 2.6382746
## 99 -2.1236833 3.2437321
Histogramas
col_sequence <- rainbow(n = 7, alpha = 0.35, start = 0, end = 1)
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC52 pEhEx - DATA', lty = 9)
abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesA[2,2], lty=2, col="darkblue") # 70% SUPERIOR
abline(v=CuantilesA[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesA[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesA[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesA[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesA[6,1], lty=2, col="red"); # 90% INFERIOR
abline(v=CuantilesA[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesA[7,1], lty=2, col="blue"); # 95% INFERIOR
abline(v=CuantilesA[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesA[8,1], lty=2, col="orange"); # 99% INFERIOR
abline(v=CuantilesA[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
legend=c("65%","70%","75%","80%","85%","90%","95%","99%"),
pch=c(1,2,3,4,5,6,7,8),
col=c("darkgoldenrod4","darkblue","aquamarine4",
"green", "brown","red","blue","orange"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC52 pEhEx - ADJUSTED', lty=9)
abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesD[2,2], lty=2, col="darkblue"); # 70% SUPERIOR
abline(v=CuantilesD[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesD[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesD[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesD[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesD[6,1], lty=2, col="red"); # 90% INFERIOR
abline(v=CuantilesD[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesD[7,1], lty=2, col="blue"); # 95% INFERIOR
abline(v=CuantilesD[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesD[8,1], lty=2, col="orange"); # 99% INFERIOR
abline(v=CuantilesD[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
legend=c("65%","70%","75%","80%","85%","90%","95%","99%"),
pch=c(1,2,3,4,5,6,7,8),
col=c("darkgoldenrod4","darkblue","aquamarine4",
"green", "brown","red","blue","orange"))
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC52 pEhEx - DATA', lty=9)
abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"),
pch=c(1,2),col=c("darkgoldenrod4","green"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC52 - ADJUSTED', lty=9)
abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"),
pch=c(1,2),col=c("darkgoldenrod4","green"))
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC52 pEhEx - DATA', lty=9)
abline(v=CuantilesA[2,1], lty=2, col="darkblue");
abline(v=CuantilesA[2,2], lty=2, col="darkblue")
abline(v=CuantilesA[5,1], lty=2, col="brown");
abline(v=CuantilesA[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
pch=c(1,2),#3,4,5,6,7,8),
col=c("brown"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC52 pEhEx - ADJUSTED', lty=9)
abline(v=CuantilesD[2,1], lty=2, col="darkblue");
abline(v=CuantilesD[2,2], lty=2, col="darkblue")
abline(v=CuantilesD[5,1], lty=2, col="brown");
abline(v=CuantilesD[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
pch=c(1,2),#3,4,5,6,7,8),
col=c("brown"))
log2vsCDC53 <- data1$log2samplevsCDC53; head(mean(log2vsCDC53)); head(sd(log2vsCDC53))
## [1] 6.11433
## [1] 2.904448
head(log2vsCDC53,5)
## [1] 8.137224 9.332642 10.134283 7.867231 1.641542
ndata1 <- length(log2vsCDC53)
** Primer histograma**
hist(log2vsCDC53, breaks = nbreaks, col= rainbow(25,0.3),
main = 'Log2vsCDC53')
meanlog2vsCDC53 <- mean(log2vsCDC53); head(meanlog2vsCDC53)
## [1] 6.11433
StdDevlog2vsCDC53 <- sd(log2vsCDC53); head(StdDevlog2vsCDC53)
## [1] 2.904448
Normlog2vsCDC53 <- (log2vsCDC53-meanlog2vsCDC53)/StdDevlog2vsCDC53; head(Normlog2vsCDC53)
## [1] 0.6964814 1.1080632 1.3840678 0.6035230 -1.5399785 0.4537713
tst<- Normlog2vsCDC53
Segundo histograma
hist(tst, breaks = nbreaks, col= 1:5,
main = 'Normalized Log2vsCDC53',
xlab='pEhEx1',
ylab= 'Frequency pEhEx')
Ajustando modelo
fw1<-fitdist(tst, "norm")
plotdist(tst, histo = TRUE, demp = TRUE)
nnorm.f <- fitdist(tst,"norm")
summary(nnorm.f)
## Fitting of the distribution ' norm ' by maximum likelihood
## Parameters :
## estimate Std. Error
## mean -9.490135e-17 0.01447452
## sd 9.998952e-01 0.01023499
## Loglikelihood: -6770.675 AIC: 13545.35 BIC: 13558.29
## Correlation matrix:
## mean sd
## mean 1 0
## sd 0 1
par(mfrow=c(2,2))
denscomp(nnorm.f,legendtext = 'Dist Normal')
qqcomp(nnorm.f,legendtext = 'Dist Normal')
cdfcomp(nnorm.f,legendtext = 'Dist Normal')
ppcomp(nnorm.f,legendtext = 'Dist Normal')
Calculo de cuantiles
probs <- c();
probs[8] = 0.175; probs[9] = 0.825;
probs[7] = 0.15; probs[10] = 0.85;
probs[6] = 0.125; probs[11] = 0.875;
probs[5] = 0.1; probs[12] = 0.9;
probs[4] = 0.075; probs[13] = 0.925;
probs[3] = 0.05; probs[14] = 0.95;
probs[2] = 0.025; probs[15] = 0.975;
probs[1] = 0.005; probs[16] = 0.995;
CuantilesData <- quantile(tst,prob = probs)
CuantilesModel <- qnorm(probs, mean=0, sd=1)
Cuantilillos <- t(CuantilesModel)
colnames(Cuantilillos) <- c('0.5%','2.5%','5%','7.5%',
'10%','12.5%','15%','17.5%',
'82.5%','85%','87.5%','90%',
'92.5%','95%','97.5%','99.5%')
Cuantilillos <- t(Cuantilillos)
colnames(Cuantilillos) <- c('Cuantiles Ajuste')
print(Cuantilillos)
## Cuantiles Ajuste
## 0.5% -2.5758293
## 2.5% -1.9599640
## 5% -1.6448536
## 7.5% -1.4395315
## 10% -1.2815516
## 12.5% -1.1503494
## 15% -1.0364334
## 17.5% -0.9345893
## 82.5% 0.9345893
## 85% 1.0364334
## 87.5% 1.1503494
## 90% 1.2815516
## 92.5% 1.4395315
## 95% 1.6448536
## 97.5% 1.9599640
## 99.5% 2.5758293
CuantilesA <- matrix(0,8,2)
CuantilesD <- matrix(0,8,2)
colnames(CuantilesA) <- c('LimInf','LimSup')
colnames(CuantilesD) <- c('LimInf','LimSup')
rownames(CuantilesA) <- c('65','70','75','80','85','90','95','99')
rownames(CuantilesD) <- c('65','70','75','80','85','90','95','99')
CuantilesA[1,1] <-CuantilesData[8]; CuantilesA[1,2] <-CuantilesData[9]
CuantilesA[2,1] <-CuantilesData[7]; CuantilesA[2,2] <-CuantilesData[10]
CuantilesA[3,1] <-CuantilesData[6]; CuantilesA[3,2] <-CuantilesData[11]
CuantilesA[4,1] <-CuantilesData[5]; CuantilesA[4,2] <-CuantilesData[12]
CuantilesA[5,1] <-CuantilesData[4]; CuantilesA[5,2] <-CuantilesData[13]
CuantilesA[6,1] <-CuantilesData[3]; CuantilesA[6,2] <-CuantilesData[14]
CuantilesA[7,1] <-CuantilesData[2]; CuantilesA[7,2] <-CuantilesData[15]
CuantilesA[8,1] <-CuantilesData[1]; CuantilesA[8,2] <-CuantilesData[16]
CuantilesD[1,1] <-Cuantilillos[8]; CuantilesD[1,2] <-Cuantilillos[9]
CuantilesD[2,1] <-Cuantilillos[7]; CuantilesD[2,2] <-Cuantilillos[10]
CuantilesD[3,1] <-Cuantilillos[6]; CuantilesD[3,2] <-Cuantilillos[11]
CuantilesD[4,1] <-Cuantilillos[5]; CuantilesD[4,2] <-Cuantilillos[12]
CuantilesD[5,1] <-Cuantilillos[4]; CuantilesD[5,2] <-Cuantilillos[13]
CuantilesD[6,1] <-Cuantilillos[3]; CuantilesD[6,2] <-Cuantilillos[14]
CuantilesD[7,1] <-Cuantilillos[2]; CuantilesD[7,2] <-Cuantilillos[15]
CuantilesD[8,1] <-Cuantilillos[1]; CuantilesD[8,2] <-Cuantilillos[16]
print(CuantilesD)
## LimInf LimSup
## 65 -0.9345893 0.9345893
## 70 -1.0364334 1.0364334
## 75 -1.1503494 1.1503494
## 80 -1.2815516 1.2815516
## 85 -1.4395315 1.4395315
## 90 -1.6448536 1.6448536
## 95 -1.9599640 1.9599640
## 99 -2.5758293 2.5758293
print(CuantilesA)
## LimInf LimSup
## 65 -0.8305939 0.8018512
## 70 -0.8877013 0.9412276
## 75 -0.9522378 1.1212912
## 80 -1.0264291 1.3220406
## 85 -1.1638210 1.5939827
## 90 -1.2824356 2.0684839
## 95 -1.4385679 2.6057307
## 99 -1.8396440 3.5572717
Histogramas
col_sequence <- rainbow(n = 7, alpha = 0.35, start = 0, end = 1)
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC53 pEhEx - DATA', lty = 9)
abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesA[2,2], lty=2, col="darkblue") # 70% SUPERIOR
abline(v=CuantilesA[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesA[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesA[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesA[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesA[6,1], lty=2, col="red"); # 90% INFERIOR
abline(v=CuantilesA[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesA[7,1], lty=2, col="blue"); # 95% INFERIOR
abline(v=CuantilesA[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesA[8,1], lty=2, col="orange"); # 99% INFERIOR
abline(v=CuantilesA[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
legend=c("65%","70%","75%","80%","85%","90%","95%","99%"),
pch=c(1,2,3,4,5,6,7,8),
col=c("darkgoldenrod4","darkblue","aquamarine4",
"green", "brown","red","blue","orange"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC53 pEhEx - ADJUSTED', lty=9)
abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[2,1], lty=2, col="darkblue"); # 70% INFERIOR
abline(v=CuantilesD[2,2], lty=2, col="darkblue"); # 70% SUPERIOR
abline(v=CuantilesD[3,1], lty=2, col="aquamarine4"); # 75% INFERIOR
abline(v=CuantilesD[3,2], lty=2, col="aquamarine4"); # 75% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
abline(v=CuantilesD[5,1], lty=2, col="brown"); # 85% INFERIOR
abline(v=CuantilesD[5,2], lty=2, col="brown"); # 85% SUPERIOR
abline(v=CuantilesD[6,1], lty=2, col="red"); # 90% INFERIOR
abline(v=CuantilesD[6,2], lty=2, col="red"); # 90% SUPERIOR
abline(v=CuantilesD[7,1], lty=2, col="blue"); # 95% INFERIOR
abline(v=CuantilesD[7,2], lty=2, col="blue"); # 95% SUPERIOR
abline(v=CuantilesD[8,1], lty=2, col="orange"); # 99% INFERIOR
abline(v=CuantilesD[8,2], lty=2, col="orange"); # 99% SUPERIOR
legend("topright",
legend=c("65%","70%","75%","80%","85%","90%","95%","99%"),
pch=c(1,2,3,4,5,6,7,8),
col=c("darkgoldenrod4","darkblue","aquamarine4",
"green", "brown","red","blue","orange"))
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC53 pEhEx - DATA', lty=9)
abline(v=CuantilesA[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesA[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesA[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesA[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"),
pch=c(1,2),col=c("darkgoldenrod4","green"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC51 - ADJUSTED', lty=9)
abline(v=CuantilesD[1,1], lty=2, col="darkgoldenrod4"); # 65% INFERIOR
abline(v=CuantilesD[1,2], lty=2, col="darkgoldenrod4"); # 65% SUPERIOR
abline(v=CuantilesD[4,1], lty=2, col="green"); # 80% INFERIOR
abline(v=CuantilesD[4,2], lty=2, col="green"); # 80% SUPERIOR
legend("topright",legend=c("65%","80%"),
pch=c(1,2),col=c("darkgoldenrod4","green"))
par(mfrow=c(2,1))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC53 pEhEx - DATA', lty=9)
abline(v=CuantilesA[2,1], lty=2, col="darkblue");
abline(v=CuantilesA[2,2], lty=2, col="darkblue")
abline(v=CuantilesA[5,1], lty=2, col="brown");
abline(v=CuantilesA[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
pch=c(1,2),#3,4,5,6,7,8),
col=c("brown"))
hist(tst, breaks = nbreaks, col = col_sequence,
main = 'Normalized Log2vsCDC53 pEhEx - ADJUSTED', lty=9)
abline(v=CuantilesD[2,1], lty=2, col="darkblue");
abline(v=CuantilesD[2,2], lty=2, col="darkblue")
abline(v=CuantilesD[5,1], lty=2, col="brown");
abline(v=CuantilesD[5,2], lty=2, col="brown")
legend("topright",legend=c("70%","85%"),
pch=c(1,2),#3,4,5,6,7,8),
col=c("brown"))